import rtconfig
Import('RTT_ROOT')
from building import *

# get current directory
cwd = GetCurrentDir()

src = Split("""
StdPeriph_Driver/src/ch32v10x_adc.c
StdPeriph_Driver/src/ch32v10x_bkp.c
StdPeriph_Driver/src/ch32v10x_crc.c
StdPeriph_Driver/src/ch32v10x_dbgmcu.c
StdPeriph_Driver/src/ch32v10x_dma.c
StdPeriph_Driver/src/ch32v10x_exti.c
StdPeriph_Driver/src/ch32v10x_flash.c
StdPeriph_Driver/src/ch32v10x_gpio.c
StdPeriph_Driver/src/ch32v10x_i2c.c
StdPeriph_Driver/src/ch32v10x_iwdg.c
StdPeriph_Driver/src/ch32v10x_misc.c
StdPeriph_Driver/src/ch32v10x_pwr.c
StdPeriph_Driver/src/ch32v10x_rcc.c
StdPeriph_Driver/src/ch32v10x_rtc.c
StdPeriph_Driver/src/ch32v10x_spi.c
StdPeriph_Driver/src/ch32v10x_tim.c
StdPeriph_Driver/src/ch32v10x_usart.c
StdPeriph_Driver/src/ch32v10x_wwdg.c
CMSIS/core_riscv.c
CMSIS/WCH/CH32V10x/Source/system_ch32v10x.c
CMSIS/WCH/CH32V10x/Source/GCC/startup_ch32v10x.S
""")

path = [
	cwd + '/CMSIS',
    cwd + '/CMSIS/WCH/CH32V10x/Include',
    cwd + '/StdPeriph_Driver/inc']


group = DefineGroup('ch32v10x_lib', src, depend = [''], CPPPATH = path)

Return('group')
